<template>

  <div class="vivid-tooltip-container">
    <slot></slot>
    <div class="vivid-tooltip">
      <slot name="tooltip"></slot>
    </div>
  </div>

</template>

<style scoped>
.vivid-tooltip-container {
  position: relative;
  display: inline-block;
}


.vivid-tooltip {
  position: absolute;
  bottom: calc(100% + 15px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  padding: 12px 20px;
  background: linear-gradient(135deg, #ffffff, #f8f9fa);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  color: #1f2937;
  font-size: 14px;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  border: 1px solid rgba(229, 231, 235, 1);
}

.vivid-tooltip::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border-width: 8px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

.vivid-tooltip-container:hover .vivid-tooltip,
.help-button:focus+.vivid-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
</style>
